package cate.common.table.fight.skill.row;

import cate.common.table.ERow;
import cate.common.table.XSSFRowWrap;
import cp.solution.util.str.Str;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;
import lombok.Data;

import java.util.List;

@NoteClass("强化效果")
@Data
public class SkillEnhanceRow extends ERow {

	@NoteField("效果ID")
	public int tid;

	@NoteField("目标技能类型")
	public Integer targetType;

	@NoteField("目标技能")
	private String targetSkillStr;

	@NoteField("目标标签")
	private String targetTagStr;

	@NoteField("目标主动效果类型")
	private String targetEffectTypeStr;

	@NoteField("物理技能特性")
	public Boolean featurePhy;

	@NoteField("法术技能特性")
	public Boolean featureMagic;

	@NoteField("冷却回合")
	public Integer cd;

	@NoteField("重选目标")
	public Byte retarget;

	@NoteField("作用目标数")
	public Integer tarNum;

	@NoteField("特殊目标规则")
	public Byte cSpecial;

	@NoteField("作用职业")
	private String cJobCode;

	@NoteField("作用阵营")
	private String cCampCode;

	@NoteField("排序属性")
	public Integer cAttr;

	@NoteField("作用技能标签")
	private String cSkillTagCode;

	@NoteField("作用buff标签")
	private String cSkillBuffCode;

	@NoteField("主动效果配置")
	private String effectCfgCode;

	@NoteField("buff添加规则")
	private String buffAddRuleCode;

	@NoteField("施法者临时属性")
	private String castTempAttrCode;

	@NoteField("主动脚本参数")
	private String activeScriptArgCode;

	@NoteField("被动脚本参数")
	private String passiveScriptArgCode;

	@NoteField("被动buff")
	public String passiveBuffCode;

	@NoteField("子技能ID")
	private String subIdCode;

	@Override
	public void parse(XSSFRowWrap xrw) {
		super.parse(xrw);
		this.id = xrw.getInteger("效果ID",0);
		this.tid = xrw.getInteger("效果ID",0);
		this.targetType = xrw.getInteger("目标技能类型");
		this.targetSkillStr = xrw.getString("目标技能");
		this.targetTagStr = xrw.getString("目标标签");
		this.targetEffectTypeStr = xrw.getString("目标主动效果类型");

		this.featurePhy  = xrw.getBoolean("物理技能特性");
		this.featureMagic  = xrw.getBoolean("法术技能特性");
		this.cd = xrw.getInteger("冷却回合");
		this.retarget = xrw.getByte("重选目标");


		this.tarNum = xrw.getInteger("作用目标数");
		this.cSpecial = xrw.getByte("特殊目标规则");
		this.cJobCode = xrw.getString("作用职业");
		this.cCampCode = xrw.getString("作用阵营");
		this.cAttr = xrw.getInteger("排序属性");
		this.cSkillTagCode = xrw.getString("作用技能标签");
		this.cSkillBuffCode = xrw.getString("作用buff标签");


		this.effectCfgCode = xrw.getString("主动效果配置");
		this.buffAddRuleCode = xrw.getString("buff添加规则");
		this.castTempAttrCode = xrw.getString("施法者临时属性");
		this.activeScriptArgCode = xrw.getString("主动脚本参数");
		this.passiveScriptArgCode = xrw.getString("被动脚本参数");
		this.passiveBuffCode = xrw.getString("被动buff");

		this.subIdCode = xrw.getString("子技能ID");


	}



	public List<Integer> tarSkills;
	public List<String> tarTags;
	public List<String> tarEffectTypes;

	public List<Byte> cJobs;
	public List<Byte> cCamps;
	public List<String> cSkillTags;
	public List<String> cBuffTags;

	public List<String> exEffects;
	public List<String> exBuffAddRules;
	public List<String> exCasterAttrs;
	public List<String> exActiveScriptArgs;
	public List<String> exPassiveScriptArgs;

	public List<Integer> exSubSkills;
	public List<String> exPassiveBuffs;

	public void decode() {
		tarSkills = Str.str2IntList(targetSkillStr,"#");
		tarTags = Str.str2StrList(targetTagStr,"#");
		tarEffectTypes = Str.str2StrList(targetEffectTypeStr,"#");

		cJobs = Str.str2ByteList(cJobCode,"#");
		cCamps = Str.str2ByteList(cCampCode,"#");
		cSkillTags = Str.str2StrList(cSkillTagCode,"#");
		cBuffTags = Str.str2StrList(cSkillBuffCode,"#");

		exEffects = Str.str2StrList(effectCfgCode,",");
		exBuffAddRules = Str.str2StrList(buffAddRuleCode, ",");
		exCasterAttrs = Str.str2StrList(castTempAttrCode,",");
		exActiveScriptArgs = Str.str2StrList(activeScriptArgCode,",");
		exPassiveScriptArgs = Str.str2StrList(passiveScriptArgCode,",");

		exPassiveBuffs = Str.str2StrList(passiveBuffCode,"#");
		exSubSkills = Str.str2IntList(subIdCode,"#");
	}
}
